package provider

import (
	"context"
	"go-pan/internal/storage"
	"path/filepath"
)

type LocalFileStorageProvider struct {
	basePath string
}

func NewLocalFileStorageProvider(basePath string) *LocalFileStorageProvider {
	return &LocalFileStorageProvider{
		basePath: basePath,
	}
}

func (p *LocalFileStorageProvider) GetUserStorage(ctx context.Context, userID string) (storage.Storage, error) {

	path := filepath.Join(p.basePath, userID)
	return storage.NewLocalFileStorage(ctx, path), nil
}
